<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>课程列表</title>
    <script src="/jquery/jquery-3.2.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            width: 100%;
            height: 800px;
        }
        .list{
            width: 1650px;
            height: 50px;
            margin-left: 20px;
            background-color:rgb(243,243,243);
        }
        .list-left{
            width: 100px;
            height: 30px;
            margin-top: 10px;
            float: left;
        }
        .list-left-left{
            width: 10px;
            height: 30px;
            float: left;
            background: green;
        }
        .list-left-right{
            width: 80px;
            height: 30px;
            font-size: 14px;
            line-height: 30px;
            float: left;
            text-indent: 5px;
        }
        .list-right{
            float: right;
            margin-top: 5px;
            margin-right: 30px;
        }
        .query{
            width: 1650px;
            height: 100px;
            margin-top: 20px;
            margin-left: 20px;
        }
        .layui-col-md11{
            width: 100%;
        }
        .layui-card-header{
            background-color:rgb(243,243,243);
        }
        .layui-form-label{
            width: 120px;
        }
        .layui-form-item .layui-input-inline {
            float: left;
            width: 305px;
            margin-right: 10px;
        }
        .record{
            width: 1650px;
            height: 821px;
            margin-top: 40px;
            margin-left: 20px;
            background-color:rgb(243,243,243);
        }
        .import{
            margin-left: 870px;
        }
        #button_ids{
            display: none;
        }
        .record-left{
            width: 300px;
            float: left;
        }
        .record-right{
            width: 1350px;
            height: 700px;
            margin-left: 15px;
            float: left;
        }
        .layui-table-cell {
            line-height: 47px;
            height: inherit;
        }
        .layui-table-cell>a{
            color:green;
        }
        .layui-table-fixed {
            position: absolute;
            left: 0px;
            top: 0px;
            z-index: 101;
        }
        div#rMenu {position:absolute; visibility:hidden; top:0; background-color: #555;text-align: left;padding: 2px;}
        div#rMenu ul li {
            margin: 1px 0;
            padding: 0 5px;
            cursor: pointer;
            list-style: none outside none;
            background-color: #DFDFDF;
        }
        #sear{
            margin-left: 15px;
        }
    </style>
</head>
<body>
<div class="box">
    <!--商品列表-->
    <div class="list">
        <div class="list-left">
            <div class="list-left-left"></div>
            <p class="list-left-right">课程日志</p>
        </div>
        <div class="list-right">
            <div class="list-right-left layui-btn layui-icon layui-icon-refresh" onclick="refresh()">&nbsp;刷新</div>
            <div class="list-right-right layui-btn layui-icon layui-icon-left" id="goBack">&nbsp;返回</div>
        </div>
    </div>
    <!--筛选查询-->
    <div class="layui-row query">
        <div class="layui-col-md11">
            <div class="layui-card headerCenter">
                <div class="layui-card-header backColor">
                    <i class="layui-icon">&#xe615;</i>
                    筛选查询
                </div>
                <div class="layui-card-body">
                    <form class="layui-form">
                        <div class="layui-form-item">
                            <label class="layui-form-label">课程编号：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="dictLabel" required lay-verify="required" placeholder="请输入商品编号" autocomplete="off" class="layui-input">
                            </div>

                            <label class="layui-form-label">课程名称：</label>
                            <div class="layui-input-inline">
                                <input type="text" name="dictValue" required lay-verify="required" placeholder="请输入商品名称" autocomplete="off" class="layui-input">
                            </div>

                            <label class="layui-form-label">操作时间：</label>
                            <div class="layui-input-inline">
                                <input type="text" id="createTime" name="createTime" required lay-verify="required" placeholder="请选择上传时间" autocomplete="off" class="layui-input">
                            </div>

                            <span>
                                <button type="button" class="layui-btn" onclick="search()" id="sear">
                                    <i class="layui-icon layui-icon-search"></i> 搜索
                                </button>
                                <button type="reset" class="layui-btn layui-btn-warm">
                                    <i class="layui-icon layui-icon-refresh"></i> 重置
                                </button>
                            </span>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!--数据列表-->
    <div class="record">
        <div class="record-right">
            <!--表-->
            <table id="demoTable" lay-filter="demoTable"></table>
        </div>
    </div>
    <!--表头样式-->
    <div id="button_ids">
        <i class="layui-icon layui-icon-align-left"></i> 商品操作日志列表
    </div>
</div>
<!-- 返回 -->
<p id="title" style="display: none;">课程历史价格详情</p>
<script>
    layui.use(['jquery','table','laydate'],function(){
        var $ = layui.jquery;
        var table = layui.table;
        var laydate = layui.laydate;

        laydate.render({
            elem: '#createTime',
            type: 'datetime',
            trigger: 'click'
        })

        demoTable();

        refresh = function refresh(){
            location.reload();
        }
        //返回
        $('#goBack').click(function () {
            var title = $('#title').text();
            var iframe = parent.$('.iframe');
            $.each(iframe,function (i,item) {
                if(title == $(item).attr('_href')){
                    parent.$('#beforeHref').val($(item).attr('_href'));
                    parent.beforeHref();
                    return;
                }
            });
        });

        getTable('','','','');

        function getTable(dictLabel,dictValue,createTime){
            $.ajax({
                url:"/course/getCoursePrice",
                type:"post",
                dataType:"json",
                data:{'dictLabel':dictLabel,'dictValue':dictValue,'createTime':createTime},
                success:function (data) {
                    demoTable(data.data);
                }
            })
        }

        search = function search(){
            var dictLabel=$("input[name=dictLabel]").val();
            var dictValue=$("input[name=dictValue]").val();
            var createTime=$("input[name=createTime]").val();
            getTable(dictLabel,dictValue,createTime);
        }

        /*表格*/
        function demoTable(data){
            table.render({
                elem:'#demoTable',
                title:"委托书",
                data:data,
                toolbar:'#button_ids',
                limit:10,
                width:1620,
                page:{
                    layout:['count','prev','page','next','limit','skip','refresh'],
                    limits:[10],
                    first:"首页",
                    last:"尾页",
                },
                cols:[[
                    {type:'checkbox'},
                    {title:"序号",align:'center',width:100,templet:function(data){
                            return data.LAY_INDEX;
                        }},
                    {field:"dictLabel",title:"商品编号",align:'center',width:300},
                    {field:"dictValue",title:"商品名称",align:'center',width:300},
                    {field:"cssClass",title:"原价",align:'center',width:290},
                    {field:"listClass",title:"现价",align:'center',width:280},
                    {field:"createTime",title:"操作时间",align:'center',width:294},
                ]]
            })
        }

    })
</script>
</body>
</html>